package top.linyuxb.lycloud.admin.service;

import top.linyuxb.lycloud.admin.entity.LyCloudUserEntity;

import java.util.List;
import java.util.Set;

/**
 * Created by Intellij IDEA.
 *
 * @Author: linyuxb
 * @Date: 2024/8/7 11:09
 * @Desc: 权限服务
 */
public interface ILyConfPermissionService {
    /**
     * 权限检查
     *
     * @param loginUser
     * @param loginEnv
     * @param appname
     * @return
     */
    Boolean ifHasProjectPermission(LyCloudUserEntity loginUser, String loginEnv, String appname);

    /**
     * 获取权限服务 app#env
     *
     * @param loginUser
     * @param servers
     * @return true 超管，全量；false 普通，检查servers
     */
    Boolean getPermissionServers(LyCloudUserEntity loginUser, Set<String> servers);

    /**
     * 获取权限app
     *
     * @param loginUser
     * @param apps
     * @return true 超管，全量；false 普通，检查servers
     */
    Boolean getPermissionApps(LyCloudUserEntity loginUser, Set<String> apps);

    /**
     * 获取权限env
     *
     * @param loginUser
     * @param envs
     * @return true 超管，全量；false 普通，检查servers
     */
    Boolean getPermissionEnvs(LyCloudUserEntity loginUser, Set<String> envs);
}
